package com.alex.serializer;

import java.io.Serializable;
import java.util.Map;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.kafka.common.header.Headers;
import org.apache.kafka.common.serialization.Serializer;

/**
 * @ClassName UserDefineSerializer
 * @Description TODO
 * @Author zjg
 * @Date 2021/12/616:43
 * @Version 2.0
 */

public class UserDefineSerializer implements Serializer<Object> {

  @Override
  public void configure(Map<String, ?> configs, boolean isKey) {
    System.out.println("configure");
  }

  @Override
  public byte[] serialize(String s, Object o) {
    return SerializationUtils.serialize((Serializable) o);
  }

  @Override
  public void close() {
    System.out.println("close");

  }
}
